#
#	Makefile for dcmect/tests
#

@SET_MAKE@

SHELL = /bin/sh
VPATH = @srcdir@:@top_srcdir@/include:@top_srcdir@/@configdir@/include
srcdir = @srcdir@
top_srcdir = @top_srcdir@
configdir = @top_srcdir@/@configdir@

include $(configdir)/@common_makefile@

oficonvdir = $(top_srcdir)/../oficonv
ofstddir = $(top_srcdir)/../ofstd
oflogdir = $(top_srcdir)/../oflog
dcmdatadir = $(top_srcdir)/../dcmdata
dcmioddir = $(top_srcdir)/../dcmiod
dcmfgdir = $(top_srcdir)/../dcmfg

LIBDIRS = -L$(top_srcdir)/libsrc -L$(ofstddir)/libsrc -L$(oflogdir)/libsrc \
	-L$(dcmdatadir)/libsrc -L$(dcmioddir)/libsrc -L$(dcmfgdir)/libsrc \
	-L$(oficonvdir)/libsrc
LOCALLIBS = -ldcmect -ldcmfg -ldcmiod -ldcmdata -loflog -lofstd -loficonv \
	$(ZLIBLIBS) $(CHARCONVLIBS) $(MATHLIBS)
LOCALINCLUDES = -I$(top_srcdir)/include -I$(configdir)/include -I$(ofstddir)/include -I$(oflogdir)/include \
	-I$(dcmdatadir)/include -I$(dcmioddir)/include -I$(dcmfgdir)/include

test_objs = tests.o t_huge_concat.o t_overflow.o t_roundtrip.o
objs = $(test_objs)
progs = tests


all: $(progs)

tests: $(test_objs)
	$(CXX) $(CXXFLAGS) $(LIBDIRS) $(LDFLAGS) $(LOCALINCLUDES) -o $@ $(test_objs) $(LOCALLIBS) $(LIBS)


check: tests
	DCMDICTPATH=../../dcmdata/data/dicom.dic ./tests

check-exhaustive: tests
	DCMDICTPATH=../../dcmdata/data/dicom.dic ./tests -x


install: all


clean:
	rm -f $(objs) $(progs) $(LOCALTRASH) $(TRASH)

distclean:
	rm -f $(objs) $(progs) $(LOCALTRASH) $(DISTTRASH)


dependencies:
	$(CXX) -MM $(defines) $(includes) $(CPPFLAGS) $(CXXFLAGS) *.cc  > $(DEP)

include $(DEP)
